package com.cq.hd.task.web.job;

import com.cq.hd.order.api.TbMonthSettleBillApi;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 月度结算任务
 *
 * @author much
 * @since 2024/04/09 23:24
 */
@Slf4j
@Component
public class MonthSettleTask {

    @Resource
    private TbMonthSettleBillApi monthSettleBillApi;

    /**
     * 执行月度结算，生成月度结算账单
     * 执行对象：orderSettleBill商户补贴
     * 频率：每个月5号执行
     */
    @XxlJob("executeMonthlySettlement")
    public void executeMonthlySettlement() {
        log.info("executeMonthlySettlement ===> start");
        monthSettleBillApi.executeMonthlySettlement();
        log.info("executeMonthlySettlement ===> end");
    }

    /**
     * 执行商户本金二次结算 for 结算池商户本金提现提现
     */
    @XxlJob("executeMerchantAmtSettlement")
    public void executeMerchantAmtSettlement() {
        log.info("executeMerchantAmtSettlement ===> start");
        monthSettleBillApi.executeMerchantAmtSettlement();
        log.info("executeMerchantAmtSettlement ===> end");
    }


}
